package com.itheima.service.impl;

import com.itheima.dao.UserDao;
import com.itheima.service.UserService;

public class UserServiceImpl2 implements UserService {
    //属性除了set方法可以赋值,还可以通过构造方法
    private String name;

    private int age;

   private UserDao userDao;

//    public UserServiceImpl2() {
//    }

    public UserServiceImpl2(String name, int age, UserDao userDao) {
        this.name = name;
        this.age = age;
        this.userDao = userDao;
    }

    @Override
    public void save() {
        System.out.println("userservice save...222");
        System.out.println(name + "," + age);
        userDao.saveUser();
    }


}
